#ifndef XMIREADER_H
#define XMIREADER_H

#include <QDomDocument>
#include <QMessageBox>
#include <QMap>
#include <QTextStream>
#include <QFile>

#include "io/reader/abstractreader.h"
#include "uml/projects/umlclassdiagramm.h"
#include "uml/datatypedictionary.h"

class XMIReader : public AbstractReader
{
public:
    XMIReader();

    void setIsWMI(bool isWMI);

    DatatypeDictionary *dataTypeDictionary();

    void run();

protected:
    bool _isWMI;
    QMap<QString, UmlRelationalItem*> _relationalItems;

    QMap<QString, QDomElement> _ownedAttributes;

    UmlProject::ProjectType projectType(QDomElement root);

    void parseCustomDataTypes(QDomElement root);
    UmlGraphicsItem* parseElements(QDomElement root);
    void parseClass(QDomElement root, UmlClassItem *classItem);
    void parseRelations(QDomElement root);
};

#endif // XMIREADER_H
